﻿using System;
using Cloud.BaseCode;

namespace Cloud.Util
{
    public partial class ParameterXml : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(GetQueryString("TableName")))
            {
                Response.End();
                return;
            }
            var xml = "<?xml version=\"1.0\"?><ParametreList>";
            var dtoList = CloudDao().Cache().CloudParametre().FindByTabloAdi(GetQueryString("TableName"));
            foreach(var dto in dtoList)
            {
                xml += "<Parametre>";
                xml += "<Kodu>" + dto.Kodu + "</Kodu>";
                xml += "<Aciklama>" + dto.Aciklama + "</Aciklama>";
                xml += "<Alan1>" + dto.Alan1 + "</Alan1>";
                xml += "<Alan2>" + dto.Alan2 + "</Alan2>";
                xml += "<Alan3>" + dto.Alan3 + "</Alan3>";
                xml += "<Alan4>" + dto.Alan4 + "</Alan4>";
                xml += "<Aktif>" + dto.Aktif + "</Aktif>";
                xml += "<Sira>" + dto.Sira + "</Sira>";
                xml += "</Parametre>";
            }
            xml += "</ParametreList>";
            Response.Write(xml);
            Response.End();
        }
    }
}